* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style: none;
}

body {
    background-image: linear-gradient(to top,
            #99D9EA 0%,
            #99D9EA 50%,
            #00A2E8 50%,
            #00A2E8 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

#nav {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    overflow-x: hidden;
    border-radius: 8px;
    padding: 20px;
    transition: width 0.6s linear;
}

#nav.active {
    width: 400px;
}

#nav.active ul {
    width: 100%;
}

ul {
    display: flex;
    justify-content: center;
    width: 0;
    padding: 0;
    margin: 0;
    transition: width 0.6s linear;
}

ul li {
    padding-left: 10px;
    position: relative;
    opacity: 0;
    transition: transform 0.6s linear, opacity 0.6s linear;
}

#nav.active ul li {
    opacity: 1;
    transform: rotateY(360deg);
}

ul li a {
    text-decoration: none;
    position: relative;
    color: black;
    margin: 0 10px;
}

.icon {
    position: relative;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
    background-color: white;
}

.icon .line {
    position: absolute;
    background-color: #99D9EA;
    width: 20px;
    height: 2px;
    top: 6px;
    transition: transform 0.6s linear;
}

.icon .line2 {
    top: auto;
    bottom: 6px;
}


#nav.active .icon .line1 {
    transform: rotate(-765deg) translateY(4px)
}

#nav.active .icon .line2 {
    transform: rotate(765deg) translateY(-4px)
}